/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * LabelDialogPane.java
 *
 * Created on 27-ene-2010, 12:46:10
 */

package geobloc.desktop.dialogs;

import java.util.Vector;

/**
 *
 * @author Usuario
 */
public class LabelDialogPane extends javax.swing.JPanel {

    /** Creates new form LabelDialogPane */
    public LabelDialogPane() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    textLabel = new javax.swing.JLabel();
    textTextField = new javax.swing.JTextField();
    descriptionLabel = new javax.swing.JLabel();
    descriptionScrollPane = new javax.swing.JScrollPane();
    descriptionTextArea = new javax.swing.JTextArea();
    idLabel = new javax.swing.JLabel();
    idTextField = new javax.swing.JTextField();

    setName("Form"); // NOI18N

    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(geobloc.desktop.FormDesignerApp.class).getContext().getResourceMap(LabelDialogPane.class);
    textLabel.setText(resourceMap.getString("textLabel.text")); // NOI18N
    textLabel.setName("textLabel"); // NOI18N

    textTextField.setText(resourceMap.getString("textTextField.text")); // NOI18N
    textTextField.setName("textTextField"); // NOI18N

    descriptionLabel.setText(resourceMap.getString("descriptionLabel.text")); // NOI18N
    descriptionLabel.setName("descriptionLabel"); // NOI18N

    descriptionScrollPane.setName("descriptionScrollPane"); // NOI18N

    descriptionTextArea.setColumns(20);
    descriptionTextArea.setFont(resourceMap.getFont("descriptionTextArea.font")); // NOI18N
    descriptionTextArea.setLineWrap(true);
    descriptionTextArea.setRows(3);
    descriptionTextArea.setWrapStyleWord(true);
    descriptionTextArea.setName("descriptionTextArea"); // NOI18N
    descriptionScrollPane.setViewportView(descriptionTextArea);

    idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
    idLabel.setName("idLabel"); // NOI18N

    idTextField.setText(resourceMap.getString("idTextField.text")); // NOI18N
    idTextField.setName("idTextField"); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addComponent(descriptionScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE)
      .addGroup(layout.createSequentialGroup()
        .addComponent(textLabel)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(textTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(idLabel)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
      .addComponent(descriptionLabel)
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(textLabel)
          .addComponent(textTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(idLabel)
          .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(descriptionLabel)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    );
  }// </editor-fold>//GEN-END:initComponents

    public Vector<String> getResults() {
        Vector<String> results = new Vector<String>();
        // Add the element ID
        results.add(idTextField.getText());
        // Add the description or null if it wasn't written
        if (descriptionTextArea.getText().isEmpty())
            results.add(null);
        else
            results.add(descriptionTextArea.getText());
        // Add the label text
        results.add(textTextField.getText());
        return results;
    }

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JLabel descriptionLabel;
  private javax.swing.JScrollPane descriptionScrollPane;
  private javax.swing.JTextArea descriptionTextArea;
  private javax.swing.JLabel idLabel;
  private javax.swing.JTextField idTextField;
  private javax.swing.JLabel textLabel;
  private javax.swing.JTextField textTextField;
  // End of variables declaration//GEN-END:variables

}
